import { Form, Input, Button, Toast } from 'antd-mobile';
import { useState } from 'react';
import { request } from '../../utils/request.ts';

export default function Register() {
  const [form] = Form.useForm();

  const onFinish = async (values) => {
    const res = await request('/openapi/getInfo', {
      method: 'POST',
      data: {
        ...values,
      },
      isToken: false,
    });
    if (res.data) {
      Toast.show({ content: res.msg, position: 'bottom' });
    }
  };

  return (
    <div style={{ padding: 16 }}>
      <Form form={form} layout="vertical" onFinish={onFinish} footer={
        <Button block type="submit" color="primary" size="large">
          查询
        </Button>
      }>
        <Form.Item name="idcard" label="身份证号码">
          <Input placeholder="请输入身份证号码" />
        </Form.Item>
        <Form.Item name="email" label="邮箱">
          <Input placeholder="请输入邮箱" />
        </Form.Item>
        <Form.Item name="mobilephone" label="手机号">
          <Input placeholder="请输入手机号" type="tel" />
        </Form.Item>
      </Form>
    </div>
  );
} 